package com.demo.base.exception;

/**
 * @author 曳戈泰尔
 * @version 1.0
 * @description 自定义异常类
 * @date 2023/3/13 4:36 PM
 */
public class AiException extends RuntimeException {

    private String msg;
    private Object errorObj;
    protected int code;

    public AiException() {}

    public AiException(String message) {
        super(message);
        this.code = 1;
        this.msg = message;
    }

    public AiException(int code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }

    public AiException(int code, String message, Object errorObj) {
        super(message);
        this.code = code;
        this.msg = message;
        this.errorObj = errorObj;
    }

    public AiException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setErrorObj(Object errorObj) {
        this.errorObj = errorObj;
    }

    public Object getErrorObj() {
        return this.errorObj;
    }
}
